package com.mercenary.wein.screenControl.ui.batch;

import com.mercenary.wein.screenControl.command.CommandTool;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.Border;

public class CleanTheZombie extends JDialog {
    GroupCheckBoxPanel RequestJ1 = new GroupCheckBoxPanel();
    JPanel RequestJ2 = new JPanel(new BorderLayout());
    JPanel J2 = new JPanel(new BorderLayout());
    JPanel J3 = new JPanel();
    JButton j1 = new JButton("提交任务");
    static JFrame locationjf = new JFrame();

    public CleanTheZombie() {
        super(locationjf, "清理僵尸粉");
        setBounds(200, 100, 700, 550);
        setLayout(new BorderLayout());
        setVisible(true);
        add(RequestJ1, BorderLayout.WEST);
        add(RequestJ2, BorderLayout.EAST);
        RequestJ1.setPreferredSize(new Dimension(180, 550));
        RequestJ1.setBackground(Color.WHITE);
        RequestJ2.setPreferredSize(new Dimension(500, 350));
        RequestJ2.setBackground(Color.WHITE);
        RequestJ2.add(J3,BorderLayout.CENTER);
        RequestJ2.add(J2,BorderLayout.NORTH);
        final ExeModeButtonGroup jp3=new ExeModeButtonGroup(this);
        jp3.setPreferredSize(new Dimension(500,120));//设置大小
        J3.add(jp3);
        J3.add(j1);
        j1.setPreferredSize(new Dimension(80, 30));
        Border titleBorder1 = BorderFactory.createTitledBorder("请选择在线设备");
        RequestJ1.setBorder(titleBorder1);
        Border titleBorder2 = BorderFactory.createTitledBorder("清理僵尸粉");
        RequestJ1.setBorder(titleBorder2);
        final JTextArea T1 = new JTextArea(6, 3);
        Border border = BorderFactory.createLineBorder(Color.BLUE);
        T1.setBorder(border);
        T1.setPreferredSize(new Dimension(500, 100));
        JLabel label = new JLabel("请输入验证信息！(每行代表一条信息，如果有多行，每个好友随机抽取发送)");
        J2.add(label, BorderLayout.NORTH);
        J2.add(T1, BorderLayout.CENTER);
        j1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                CommandTool.clearZombie(RequestJ1.getSelectedDevices(),
                        T1.getText(),
                        jp3.getExeModeBean());
            }
        });
        RequestJ2.validate();
    }


    public static void main(String[] arge) {
        new CleanTheZombie();


    }

}

